/*
 * @Author: YNT 2501512800@qq.com
 * @Date: 2022-03-21 16:05:15
 * @LastEditors: YNT 2501512800@qq.com
 * @LastEditTime: 2022-07-22 14:19:49
 * @FilePath: \22-03-19 智慧社区\api\global.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import wxRequest from '../utils/wx-request'

class globalModel extends wxRequest {
  constructor() {
    super() // 致此 this才有效
  }
  getUserinfo() {
    return this.request({
      url: `/api/v1/user/wechat_user_info`,
    })
  }
  // 上传用户信息
  setUserInfo(data) {
    return this.request({
      url: `/api/v1/user/wechat_user_info`,
      method: 'POST',
      data,
    })
  }
  // 上传手机号 》解密手机号
  setPhone(data) {
    return this.request({
      url: `/api/v1/user/wechat_user_info_phone`,
      method: 'POST',
      data,
    })
  }
  // 操作上报
  operation(data) {
    return this.request({
      url: `/api/message/record`,
      method: 'POST',
      data,
    })
  }
}

export default new globalModel()
